import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

/*
 *@Student 张策
 */
public class Text3 {
    public static void main(String[] args) throws Exception {
        String name="e:\\Text4.dat";
        ObjectInputStream obj  = new ObjectInputStream(new FileInputStream(name));
        System.out.println(obj.readInt());
        System.out.println(obj.readChar());
        System.out.println(obj.readUTF());
        Object dog = obj.readObject();
        System.out.println(dog);
        System.out.println(dog.getClass());
        Dog dog1=(Dog) dog;
        dog1.getName();
        obj.close();
    }
}
